package org.jwd.storage.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jwd.core.entity.UserEntity;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author vizz
 * @since 2022/5/15 0:15
 */
@Mapper
@Repository
public interface UserMapper extends BaseMapper<UserEntity> {

    @Select("SELECT *\n" +
            "FROM auth\n")
    List<UserEntity> getAll();

    @Select("SELECT count(1) FROM sys_user where username=#{username}")
    List<Integer> checkUser(@Param("username") String username);
}
